package com.qf.mybatisplus.config.rabbitMQConfig;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.CustomExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

import static com.qf.mybatisplus.config.rabbitMQConfig.RabbitMQCommonConfig.*;


//@Configuration
public class DelayConfig {
    /**
     * 配置一个DELAYED Direct类型的交换机
     自定义类型  交换机
     * @return
     */

//    @Bean
//    public CustomExchange delayedCustomExChange(){
//
//        Map<String, Object> args = new HashMap<>();
//
//        args.put("x-delayed-type", "direct");
//
//        return new CustomExchange(DELAYED_DIRECT_EXCHANGE,"x-delayed-message", true, false, args);
//
//    }
//    /**
//     * 定义一个DELAYED direct队列
//     * @return
//     */
//    @Bean
//    public Queue delayedDirectQueue(){
//        return new Queue(DELAYED_DIRECT_QUEUE);
//    }
//
//    /**
//     * 配置一个delayed交换机和队列的绑定
//     * @return
//     */
//
//    @Bean
//    public Binding delayedDirectBinding(){
//        return BindingBuilder.bind(delayedDirectQueue()).to(delayedCustomExChange()).with(DELAYED_DIRECT_ROUTINGKEY).noargs();
//    }

}
